/*
 * @Author: your name
 * @Date: 2021-04-23 14:44:33
 * @LastEditTime: 2021-04-23 18:11:26
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \fantasticit\src\store\modules\about.ts
 */
/*
 * @Author: your name
 * @Date: 2021-04-21 19:15:19
 * @LastEditTime: 2021-04-22 19:54:31
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \fantasticit\src\store\modules\comment.ts
 */
// !!!关于 

import { makeAutoObservable } from "mobx"
import {getabout,getaboutList} from "../../services/modules/about"
//类型
import {IMsgabout,IMsgaboutList} from "../../util/about"
class Comment{
    aboutlist(msgcommentlist: any) {
      throw new Error('Method not implemented.');
    }
    constructor(){
        makeAutoObservable(this);
    }
    // 关于 留言板的id
    aboutId:any = [];
    // 关于 留言板列表
    aboutList:IMsgaboutList[] = []
    //页数
    page = 1
    total = 0  
    //获取文字
    async getabout(){
        let result = await getabout();
        if(result.statusCode == 200){
            this.aboutId = result.data; 
        }
    }
    //获取关于 评论的列表
    async getaboutList(id:any,page:number){
        // if (this.total && this.page * 6 >= this.total){
        //     return;
        // }
        let result = await getaboutList(id,page);
        if (result.statusCode === 200){
            this.aboutList = result.data[0]
            this.total = result.data[1];
            page++;
        }
    }
}
export default Comment;

